home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / archivers / headbanger / headbanger.readme < prev    next >
Text File  |  1999-05-25  |  9KB  |  211 lines

  1. Short:    XPK based adaptive file compressor
  2. Uploader: racs@fs2.bdtf.hu (Almos Rajnai)
  3. Author:   racs@fs2.bdtf.hu (Almos Rajnai)
  4. Type:     util/pack 
  5. Requires: OS2.0, XPK package 
  6. Version:  0.11
  7. Replace:  util/pack/headbanger.lha
  8.  
  9. Release date: 19-May-1999
  10.  
  11. ---------------------------------------------------------------------
  12.  
  13. 1. What is Headbanger?
  14.  
  15.  This program is an XPK based adaptive file compressor utility, with only a
  16. command line interface. (It is not an archiver, but a one-file only
  17. compressor!)
  18.  
  19. 2. How does it work?
  20.  
  21.  Everybody knows that the files are usually not a homogene byte-stream
  22. inside, a file almost always can be separated into some different types of
  23. data. (Think of a song module - it consists of a header, the song data, and
  24. the samples.) All kind of data can be compressed efficiently with a different
  25. kind of method.
  26.  Fortunately Amiga has a great possibility of using different methods for
  27. different kind of files trough the great XPK package. If you have ever tried
  28. to compress eg. a module-file, you have probably realized that SQSH often
  29. achieves better ratio than even the famous LZX. (Which is known unbeatable in
  30. everyday archiving.)
  31.  
  32.  Well, I tought we have a lot of nice compressors at hand, but they are
  33. working only on one whole file only.
  34.  
  35.  How Headbanger works then (in short):
  36.  - first it splits the file into small pieces,
  37.  - it tries to apply all of the given XPK compressing methods (selecting from a
  38.    list) on each pieces,
  39.  - chooses the most efficient, and uses its data in the output.
  40.  
  41.  It gained more than 50% from large data files, unlike any other packers,
  42. archivers or compressors... (Even against RAR...)
  43.  
  44. A testfile (it shows almost nothing about the efficiency but...):
  45.  
  46. ChiMai.S3M music module (Scream Tracker 3 format, woth 16 bit wide samples)
  47.  
  48. Original:                           696964 bytes
  49. xpk gzip.100:                       394040 bytes (43.5% won)
  50. lzx (strongest method, switch -9):  391920 bytes (43.7% won)
  51. lha                                 390779 bytes (43.9% won)
  52. xpk sqsh.100:                       385092 bytes (44.7% won)
  53. xpk shri.100:                       377584 bytes (45.8% won)
  54. headbanger, nibble:32Kb             351800 bytes (49.5% won)
  55. headbanger, nibble:16Kb             348312 bytes (50.0% won)
  56. headbanger, nibble:8Kb              344980 bytes (50.5% won)
  57.  
  58. 3. How to use it?
  59.  
  60.  At first you need XPK package.
  61.  Then a list of the methods to be used in ENV:, called "headbanger.methods".
  62. (Simply text file, I included one into this archive.) Why it is needed? Of
  63. course not all of the methods worth a try, and there are also methods (eg.
  64. IDEA), which are not compressors, but protectors. You can filter out these
  65. methods. (More methods, less speed...) This list-file is not really needed,
  66. but then only SHRI, SQSH and GZIP methods will be used.
  67.  The format of this file is: one line is a method to be used, if it starts
  68. with * (asterisk), then before compressing the nibble a delta will be
  69. generated. (Useful for sample files and some others, this is how SQSH works,
  70. but it worth not using it on these kind of compressing methods: SQSH, SLZX,
  71. SMPL, SDHC.)
  72.  An example:
  73.  
  74.   SQSH.100
  75.   GZIP.100
  76.   ELZX.100
  77.   *ELZX.100
  78.  
  79.  The point, and the number represents the efficiency. (100 recommended of
  80. course.)
  81.  Empty lines can be added (real empty lines only), and remarks beginning with
  82. the colon (;). Remarks and empty lines will be ignored. (See example file in
  83. this archive!)
  84.  
  85.  Then, all you have to know is command-line, parameters are:
  86.  
  87.  COMMAND/A,FILEIN/A,FILEOUT,THRESHOLD=THRE/K/N,NIBBLE/K/N,MAXNIBBLE=MAX/K/N
  88.  
  89.  COMMAND/A:     required, can be: c - compress, 
  90.                                   d - decompress a file
  91.                                   l - list the required methods for
  92.                                       decompressing a compressed file,
  93.  
  94.  FILEIN/A:      required, the name of the file to be processed (compress,
  95.                 decompress, or list)
  96.  
  97.  FILEOUT:       not required, the name of the output file, if it is not given,
  98.                 then at compressing Headbanger adds a .hdbg suffix, at
  99.                 decompressing it tries to chop .hdbg suffix, or it adds .1 to
  100.                 the filename.
  101.  
  102.  THRESHOLD=THRE/K/N: not required, the minimum differences between the result
  103.                 of two methods, in case of changing method.
  104.                 Sometimes it worth keep the method of the previous nibble.
  105.                 That is because every new method requires a header in the
  106.                 packed file, thus increment output size. This number gives
  107.                 the size of minimum acceptable difference in number of bytes,
  108.                 when comparing the two output of the methods. If not given,
  109.                 it will be 20 bytes. This feature can be turned off by the
  110.                 amount of 0, but can not be negative of course. If you see
  111.                 alternating between two methods, you possibly have to raise
  112.                 this amount.
  113.                 Not advisable a much larger amount of 1% of the nibble size.
  114.  
  115.  NIBBLE/K/N:    not required, the size of a nibble in bytes. If not given it
  116.                 will be 32768 bytes. Cannot be less than 256 bytes, and more
  117.                 than 65536 bytes.
  118.                 Usually 32 Kb or 16 Kb is the right amount, but can be
  119.                 different for each file.
  120.                 
  121.  MAXNIBBLE=MAX/K/N: not required, determines the maximum size of a nibble,
  122.                 when Headbanger uses joined repacking. (See threshold.)
  123.                 Useful for lower memory machines.
  124.                 Be careful! If you have lot of memory, and you can use any
  125.                 size, on an other system depacking can fail because of low
  126.                 memory!
  127.                 If not given, then no limit used, else should be at least 2
  128.                 times larger than nibblesize.
  129.  
  130. 4. Worth it use?
  131.  
  132.  Well... The disadvantages of this tool are:
  133.  - It is slooow... Depends on the methods you are using, but far slower than
  134.    a usual archiver or compressor.
  135.  - It is not fully automatic. You can play with the parameters, and cannot be
  136.    sure that this is the optimal configuration.
  137.  - It is rather an experiment, I see no reality of a Headbanger based
  138.    archiver for example. (I included a batch anyway, called Archbanger, it
  139.    uses LHA for compacting files, then uses Headbanger on it. Requires lot of
  140.    space on the disk.)
  141.  - It is not advised spread the compressed files, it is really annoying, when
  142.    you are not able to decompress a file, because of a missing method...
  143.  - It is a really beta release, not tested too deeply.
  144.  - LZX sometimes gives a better ratio, I was not able to clue out the exact
  145.    explanation of this. (Even when ELZX method is used...) Should be
  146.    something with the headers or at the buffering.
  147.  - There is no possibility of using compressed files in any other platform
  148.    than Amiga. (No XPK ports.)
  149.  - There is no check for corrupted files. (Some kind of CRC for example.)
  150.  
  151.  Advantages:
  152.  - You can achieve a really fine compression ratio, especially for music
  153.    modules and bitmap-type picture files.
  154.  - When you get a new XPK method, you can immediately use it.
  155.  - Decompression can be even faster than other compressors
  156.  
  157. 5. Future plans
  158.  
  159.  I am planning now an XPK method based on the knowledge of designing
  160. Headbanger. Unfortunately I have some unanswered question yet, so it is not
  161. as simple as it seemed at first.
  162.  
  163. 6. Legal
  164.  
  165.  This program is Freeware, except the sources. (Not included, I hate include
  166. my sources, I feel something like standing in the X-Ray...)
  167.  
  168.  Made with AmigaE v3.3a.
  169.  
  170.  Can be used in any non-commercial way you want, but please credit me!
  171.  This package can be redistributed in any form, but the archive should be
  172. kept together, there is nothing to remove or add.
  173.  
  174.  If you have any question/remark/advice/request/bugreport, e-mail me:
  175.  
  176.   Rajnai Álmos
  177.   (Álmos Rajnai is the english form of my name...)
  178.   also known Rachy of BiøHazard
  179.  
  180.   racs@fs2.bdtf.hu
  181.   or
  182.   racs@deimos.bdtf.hu
  183.  
  184.  I am on #amigahu channel on IRCNet almost every weekdays.
  185.  
  186.  Sorry for my poor english, I will never learn it...
  187.  
  188. 7. Thanks to
  189.  
  190.   Németh Zoltán (alias Nemech